﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Framework.WebmasterTool.Tags.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkAll").live("change", function () {
                if ($(this).is(":checked")) {
                    $(".checkbox").attr("checked", "checked");
                }
                else {
                    $(".checkbox").removeAttr("checked");
                }
            });
            $(".checkbox").live("click", function () {
                var allCheck = true;
                $(".checkbox").each(function () {
                    if (!$(this).is(":checked")) {
                        allCheck = false;
                        return;
                    }
                });
                if (allCheck == true) {
                    $("#chkAll").attr("checked", "checked");
                }
                else {
                    $("#chkAll").removeAttr("checked");
                }
            });
            $("#<%= btnDelete.ClientID %>").live("click", function () {
                var callFrom = $(this);
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog',
                function (r) {
                    if (r) {
                        __doPostBack(callFrom.attr('name').replace(/_/g, '$'), '');
                    }
                });
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="server">
    Quản lý tag
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <table align="center" width="785" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td>
                    <table width="785" align="center" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td align="right">
                                <span style="font-weight: bold">Tìm tag : </span>
                                <asp:TextBox runat="server" ID="txtKeyword" Width="200"></asp:TextBox>
                                <asp:Button runat="server" ID="btnSearch" Text="Tìm kiếm" OnClick="btnSearch_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="padding-top: 10px;">
                    <asp:GridView runat="server" Width="785" ID="grvTag" CssClass="grid" AutoGenerateColumns="false"
                        AllowPaging="true" PageSize="30" AllowSorting="true" ToolTip="all" OnSorting="grvTag_Sorting"
                        OnDataBinding="grvTag_DataBinding" OnPageIndexChanging="grvTag_PageIndexChanging">
                        <Columns>
                            <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                                <HeaderTemplate>
                                    <input id="chkAll" type="checkbox" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <input id="chkSelect" runat="server" class="checkbox" type="checkbox" title='<%# Eval("TagID") %>' />
                                </ItemTemplate>
                                <HeaderStyle Width="20px" />
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên tag" SortExpression="TagName" HeaderStyle-HorizontalAlign="Left"
                                ItemStyle-HorizontalAlign="left">
                                <ItemTemplate>
                                    <%--<asp:HyperLink ID="hplTagEdit" runat="server" NavigateUrl='<%# "TagDetails.aspx?TagID=" + Eval("TagID") %>'
                                        Text='<%# Eval("TagName") %>'></asp:HyperLink>--%>
                                    <asp:HyperLink ID="hplTagEdit" runat="server" Text='<%# Eval("TagName") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tổng tag" SortExpression="SumTag" HeaderStyle-Width="100"
                                ItemStyle-Width="100" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <%# Eval("SumTag") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <table align="center" width="300" border="0">
                                <tr>
                                    <td height="50" align="center">
                                        <div align="center">
                                            Không có dữ liệu
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                        <PagerSettings Mode="NumericFirstLast" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <br />
                    <asp:Button runat="server" ID="btnDelete" Text="Xoá các tag đã chọn" OnClick="btnDelete_Click" /><br />
                    <br />
                    <br />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
